import { useState } from 'react'
export function useFn() {
  const [username, setUsername] = useState('')
  const [password, setPassword] = useState('')
  const [repassword, setRePassword] = useState('')
  const handle = (name) => (e) => {
    if (name === 'username') {
      setUsername(e.target.value.trim())
    } else if (name === 'password') {
      setPassword(e.target.value.trim())
    } else {
      setRePassword(e.target.value.trim())
    }
  }

  return { username, password, repassword, handle }
}
